package cn.ztr.ymcc.feign.impl;

import cn.ztr.ymcc.CourseDOC;
import cn.ztr.ymcc.feign.SearchFeign;
import cn.ztr.ymcc.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class SearchFeignImpl implements FallbackFactory<SearchFeign> {
    @Override
    public SearchFeign create(Throwable throwable) {
        return new SearchFeign() {
            @Override
            public JsonResult saveBatch(List<CourseDOC> courseDOCList) {
                return JsonResult.error("es添加失败");
            }

            @Override
            public JsonResult deleteBatch(List<CourseDOC> courseDOCList) {
                return JsonResult.error("es删除失败");
            }
        };
    }
}
